ccR.Add_Rotation(
	2, -- Player Specialization
	"CC_Mage_Fire_Solo", -- Function name
	"Developed early WoD, Not recommended.", -- Description
	"CC_Mage_Fire_Talents", -- Talents button frame
	"CC_Mage_Fire_Abilities", -- Abilities button frame
	"CC_Mage_Fire_Features", -- Features button frame
	"CC_Mage_Fire_Setup" -- Setup button frame
)
function CC_Mage_Fire_Solo()
	-- Arcane Brilliance
	if not ccR.Player.HasBuff(ARCANE_BRILLIANCE) then ccR.Cast.Spell(ARCANE_BRILLIANCE) end
	
	-- Ice Block
	if ccR.Player.HasSpell(ICE_BLOCK)
	and ccR.Spell.IsReady(ICE_BLOCK)
	and not ccR.Player.HasDebuff(HYPOTHERMIA)
	and ccR.Player.Health() <= 10
	then
		ccR.Cast.Spell(ICE_BLOCK)
	end

	-- Amplify Magic
	if (ccR.Player.IsInGroup() or ccR.Player.IsInRaid())
	and ccR.Player.IsInCombat()
	and ccR.Player.HasSpell(AMPLIFY_MAGIC)
	and ccR.Spell.IsReady(AMPLIFY_MAGIC)
	and ccR.Player.Health() <= 30
	then
		ccR.Cast.Spell(AMPLIFY_MAGIC)
	end

	-- Moving
	if ccR.Player.IsMoving() then
		-- Pyroblast!
		if ccR.Player.HasBuff(PYROBLAST_BUFF)
		and ccR.Spell.CanAttack(PYROBLAST)
		and ccR.Player.IsFacing("target")
		then
			ccR.Cast.Attack(PYROBLAST)
		end
		-- Living Bomb
		if ccR.Player.HasTalent(LIVING_BOMB)
		and not ccR.Target.HasMyDebuff(LIVING_BOMB)
		and ccR.Spell.CanAttack(LIVING_BOMB)
		then
			ccR.Cast.Attack(LIVING_BOMB)
		end
		-- Scorch
		if ccR.Spell.CanAttack(SCORCH)
		and ccR.Player.IsFacing("target")
		then
			ccR.Cast.Attack(SCORCH)
		end
	else
	-- Stood still
		local vCount = ccR.Target.Count(16)
		if vCount >= 3 then
			-- Living Bomb
			if ccR.Spell.CanAttack(LIVING_BOMB)
			and not ccR.Target.HasMyDebuff(LIVING_BOMB)
			then
				ccR.Cast.Spell(LIVING_BOMB)
			end
			-- Infero Blast
			if ccR.Spell.CanAttack(INFERNO_BLAST, "target") then
				ccR.Cast.Attack(INFERNO_BLAST)
			end
		end
		-- Flame Strike
		if vCount >= 5 
		and ccR.Spell.IsReady(FLAMESTRIKE)
		then
			ccR.Cast.Spell(FLAMESTRIKE)
			if SpellIsTargeting() then CastAtPosition(ObjectPosition("target")) end
		end
		-- Combustion on Ignite
		if ccR.Target.HasMyDebuff(IGNITE)
		and ccR.Spell.IsReady(COMBUSTION)
		then
			ccR.Cast.Spell(COMBUSTION)
		end
		-- Pyroblast with both Pyroblast! and Heating Up Procs.
		--if (ccR.Player.HasBuff(HEATING_UP) or ccR.Player.BuffDuration(PYROBLAST_BUFF) <= 3)
		if ccR.Player.HasBuff(PYROBLAST_BUFF)
		and ccR.Spell.CanAttack(PYROBLAST)
		and ccR.Player.IsFacing("target")
		then
			-- Cancel Fireball if we have more than 1sec to cast it.
			if ccR.Player.IsCastingSpell(FIREBALL)
			and ccR.Player.HasLeftOnCast(1)
			then
				SpellStopCasting()
			end
			ccR.Cast.Attack(PYROBLAST)
		end
		-- Inferno Blast with Heating Up procs
		if ccR.Player.HasBuff(HEATING_UP)
		and ccR.Spell.CanAttack(INFERNO_BLAST)
		and ccR.Player.IsFacing("target")
		then
			ccR.Cast.Attack(INFERNO_BLAST)
		end
		-- Fireball as a filler spell.
		if ccR.Spell.CanAttack(FIREBALL)
		and ccR.Player.IsFacing("target")
		then
			ccR.Cast.Attack(FIREBALL)
		end
	end
end